import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: 'payment'
  },
  // 超时页面
  { path: '/expired', component: () => import('@/views/overtime') },
  // 关单页面
  { path: '/closed', component: () => import('@/views/close') },
  // 支付成功页
  { path: '/succed', component: () => import('@/views/succed') },
  // 支付失败页
  { path: '/lose', component: () => import('@/views/lose') },
  { path: '/succedes', component: () => import('@/views/succed-easy') },
  { path: '/losees', component: () => import('@/views/lose-easy') },
  { path: '/complete', component: () => import('@/views/complete') },
  // 新版选择页
  {
    path: '/payment',
    component: () => import('@/views/payment'),
    props: route => ({
      orderId: route.query.orderId,
      sign: route.query.sign
    })
  },
  // 数字货币支付页
  { path: '/crypto', component: () => import('@/views/Crypto') },
  // pacypay信用卡支付
  { path: '/pacypay', component: () => import('@/views/CreditPacypay') },
  // linkpay信用卡支付
  { path: '/linkpay', component: () => import('@/views/linkpay') },
  // PIX支付
  { path: '/pixpay', component: () => import('@/views/pixpay') },
  // 收据
  { path: '/certificate', component: () => import('@/views/Orderpage') }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
